<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" xmlns:xu="http://www.xmldb.org/xupdate">

	<p:param type="input" name="instance"/>

	<p:processor name="oxf:xslt">
		<p:input name="data" href="#instance"/>
		<p:input name="config">
			<xdb:query xsl:version="2.0" collection="/db/portal">
				<xsl:text>xquery version "1.0";</xsl:text>
				<document>{if (/widgetsList/category/widget[@id = '<xsl:value-of select="/submission/widgetId"/>']/authkey = string('')) then 'false' else 'true'}</document>
			</xdb:query>
		</p:input>
		<p:output name="data" id="query"/>
	</p:processor>
	
	<p:processor name="oxf:xmldb-query">
		<p:input name="datasource" href="/config/datasource.xml"/>
		<p:input name="query" href="#query"/>
		<p:output name="data" id="auth"/>
	</p:processor>
	
	<p:processor name="oxf:text-converter">
		<p:input name="config">
			<config/>
		</p:input>
		<p:input name="data" href="#auth"/>
		<p:output name="data" id="text"/>
	</p:processor>
	<p:processor name="oxf:http-serializer">
		<p:input name="config">
			<config>
				<content-type>text/html</content-type>
				<force-content-type>true</force-content-type>
			</config>
		</p:input>
		<p:input name="data" href="#text"/>
	</p:processor>

</p:config>